--[[
  module: Common

  This module contains functionality for scripts that run together on both client & server.

  Should be installed in both `game` & `ui` array of `project.json`.

  Availability: Game script, UI script::
  Access: Read-Only::
]]


--[[
  method: GetWeaponOption

  Get the <Common.WeaponOption> instance for given weapon ID.

  Access: Read-Only::

  Notes:
    - This method is same as <Common.WeaponOption.Create>.

  Parameters:
    weaponid - (*int / <Common.WEAPON>*) The given weapon ID.

  Returns:
    (*<Common.WeaponOption> / nil*) The weapon option instance (nil = Invalid weapon ID).

  See Also:
    - <Common.WeaponOption.Create>
]]
function Common.GetWeaponOption (weaponid)


--[[
  method: UseWeaponInven

  Enable/Disable the player's weapon inventory feature.

  Access: Read-Only::

  Parameters:
    value - (*bool*) Input value (true = Enable)(false = Disable).
]]
function Common.UseWeaponInven (value)


--[[
  method: SetSaveCurrentWeapons

  Keep the player's currently equipped weapons while dead.

  Access: Read-Only::

  Parameters:
    value - (*bool*) Input value (true = Enable)(false = Disable).
]]
function Common.SetSaveCurrentWeapons (value)


--[[
  method: SetSaveWeaponInven

  Save the player's weapon inventory contents when creating a new game save.

  Access: Read-Only::

  Warnings:
    - The current map MUST support game-save feature.
    - <Common.UseWeaponInven> is REQUIRED to be enabled.

  Parameters:
    value - (*bool*) Input value (true = Enable)(false = Disable).

  See Also:
    - <Game.Rule.CanSave>
]]
function Common.SetSaveWeaponInven (value)


--[[
  method: SetAutoLoad

  Enable/Disable auto-loading the player's game save when spawned for the first time.

  Access: Read-Only::

  Notes:
    - When disabled, player can manually load the save game by pressing `L` key.

  Warnings:
    - The current map MUST support game-save feature.

  Parameters:
    value - (*bool*) Input value (true = Enable)(false = Disable).

  See Also:
    - <Game.Rule.CanSave>
]]
function Common.SetAutoLoad (value)


--[[
  method: DisableWeaponParts

  Enable/Disable the weapons's equipped parts (such as Gun Boost, Speed, Critical, etc).

  Access: Read-Only::

  Parameters:
    value - (*bool*) Input value (true = Disable)(false = Enable).
]]
function Common.DisableWeaponParts (value)


--[[
  method: DisableWeaponEnhance

  Enable/Disable the weapons's enhancement upgrades (such as +3, +4, +6, etc).

  Access: Read-Only::

  Parameters:
    value - (*bool*) Input value (true = Disable)(false = Enable).
]]
function Common.DisableWeaponEnhance (value)


--[[
  method: DontGiveDefaultItems

  Prevent giving default items (such as USP-45) to spawned players.

  Access: Read-Only::

  Parameters:
    value - (*bool*) Input value (true = Don't give)(false = Keep give).
]]
function Common.DontGiveDefaultItems (value)


--[[
  method: DontCheckTeamKill

  Give positive score when killing teammates.

  Access: Read-Only::

  Parameters:
    value - (*bool*) Input value (true = Disable)(false = Enable).
]]
function Common.DontCheckTeamKill (value)


--[[
  method: UseScenarioBuymenu

  Replace the default Deathmatch-style weapon shop menu with classic shop menu.

  Access: Read-Only::

  Parameters:
    value - (*bool*) Input value (true = Enable)(false = Disable).
]]
function Common.UseScenarioBuymenu (value)


--[[
  method: SetNeedMoney

  Enable/Disable the weapons's prices in weapon shop menu.

  Access: Read-Only::

  Warnings:
    - <Common.UseScenarioBuymenu> is REQUIRED to be enabled.

  Parameters:
    value - (*bool*) Input value (true = Enable)(false = Disable).
]]
function Common.SetNeedMoney (value)


--[[
  method: UseAdvancedMuzzle

  Enable/Disable the advanced weapons's firing muzzles.

  Access: Read-Only::

  Parameters:
    value - (*bool*) Input value (true = Enable)(false = Disable).
]]
function Common.UseAdvancedMuzzle (value)


--[[
  method: SetMuzzleScale

  Set the size scale of weapons's firing muzzles.

  Access: Read-Only::

  Warnings:
    - <Common.UseAdvancedMuzzle> is REQUIRED to be disabled.

  Parameters:
    value - (*number*) Size multiplier.
]]
function Common.SetMuzzleScale (value)


--[[
  method: SetBloodScale

  Set the size scale of blood spray when monsters or players get hit.

  Access: Read-Only::

  Parameters:
    value - (*number*) Size multiplier.
]]
function Common.SetBloodScale (value)


--[[
  method: SetGunsparkScale

  Set the spread scale of weapons's bullet ricochet sparks.

  Access: Read-Only::

  Parameters:
    value - (*number*) Spread multiplier.
]]
function Common.SetGunsparkScale (value)


--[[
  method: SetHitboxScale

  Set the size scale of entities's hitboxes.

  Access: Read-Only::

  Parameters:
    value - (*number*) Size multiplier.
]]
function Common.SetHitboxScale (value)


--[[
  method: SetMouseoverOutline

  Draw the visible outline when player's mouse pointer is hovering over an entity (such as monsters, players).

  Access: Read-Only::

  Parameters:
    value - (*bool*) Input value (true = Enable)(false = Disable).
    color - (*table / <~Virtual Table.color>*) The outline color property.
]]
function Common.SetMouseoverOutline (value, color)


--[[
  method: SetUnitedPrimaryAmmoPrice

  Set the global price to all primary weapon magazines, cost per magazine.

  Access: Read-Only::

  Warnings:
    - <Common.UseScenarioBuymenu> is REQUIRED to be enabled.
    - <Common.SetNeedMoney> is REQUIRED to be enabled.

  Parameters:
    price - (*int*) The price to set.
]]
function Common.SetUnitedPrimaryAmmoPrice (price)


--[[
  method: SetUnitedSecondaryAmmoPrice

  Set the global price to all secondary weapon magazines, cost per magazine.

  Access: Read-Only::

  Warnings:
    - <Common.UseScenarioBuymenu> is REQUIRED to be enabled.
    - <Common.SetNeedMoney> is REQUIRED to be enabled.

  Parameters:
    price - (*int*) The price to set.
]]
function Common.SetUnitedSecondaryAmmoPrice (price)


--[[
  method: SetBuymenuWeaponList

  Set the available weapons to purchase in weapon shop menu.

  Access: Read-Only::

  Warnings:
    - <Common.UseScenarioBuymenu> is REQUIRED to be enabled.

  Parameters:
    list - (*table / <~Virtual Table.weaponList>*) The weapon list.
]]
function Common.SetBuymenuWeaponList (list)


--[[
  enum: WEAPON

  --- Lua
  Common.WEAPON
  ---

  Weapons that allowed to be spawned and configurable.

  Data Type: table::
  Access: Read-Only::

  P228                     - (*int*) (Pistol) 228 COMPACT.
  Scout                    - (*int*) (Sniper Rifle) SCHMIDT SCOUT.
  XM1014                   - (*int*) (Shotgun) LEONE YG1265 AUTO SHOTGUN.
  MAC10                    - (*int*) (Sub-machine Gun) INGRAM MAC-10.
  AUG                      - (*int*) (Assault Rifle) BULLPUP.
  DualBeretta              - (*int*) (Pistol) .40 DUAL ELITES.
  FiveSeven                - (*int*) (Pistol) ES FIVE-SEVEN.
  UMP45                    - (*int*) (Sub-machine Gun) K&M UMP45.
  SG550Commando            - (*int*) (Sniper Rifle) KRIEG 550 COMMANDO.
  Galil                    - (*int*) (Assault Rifle) IDF DEFENDER.
  FAMAS                    - (*int*) (Assault Rifle) CLARION 5.56.
  USP45                    - (*int*) (Pistol) K&M .45 TACTICAL.
  Glock18C                 - (*int*) (Pistol) 9X19MM SIDEARM.
  AWP                      - (*int*) (Sniper Rifle) MAGNUM SNIPER RIFLE.
  MP5                      - (*int*) (Sub-machine Gun) K&M SUB-MACHINE GUN.
  M249                     - (*int*) (Machine Gun) M249.
  M3                       - (*int*) (Shotgun) LEONE 12 GAUGE SUPER.
  M4A1                     - (*int*) (Assault Rifle) MAVERICK M4A1 CARBINE.
  TMP                      - (*int*) (Sub-machine Gun) SCHMIDT MACHINE PISTOL.
  G3SG1                    - (*int*) (Sniper Rifle) D3/AU-1.
  DesertEagle50C           - (*int*) (Pistol) NIGHT HAWK .50C.
  SG552                    - (*int*) (Assault Rifle) KRIEG 552.
  AK47                     - (*int*) (Assault Rifle) CV-47.
  P90                      - (*int*) (Sub-machine Gun) ES C90.
  SCAR                     - (*int*) (Assault Rifle) SCAR-L.
  USAS12                   - (*int*) (Shotgun) USAS-12.
  QBB95                    - (*int*) (Machine Gun) QBB-95.
  MG3                      - (*int*) (Machine Gun) MG3.
  DualMP7A1                - (*int*) (Sub-machine Gun) Dual MP7A1.
  AK47Custom               - (*int*) (Assault Rifle) AK-47 60R.
  DesertEagle50CGold       - (*int*) (Pistol) Desert Eagle 50C Gold.
  WinchesterM1887          - (*int*) (Shotgun) Winchester M1887.
  M134Minigun              - (*int*) (Machine Gun) M134 Minigun.
  F2000                    - (*int*) (Assault Rifle) F2000.
  WinchesterM1887Gold      - (*int*) (Shotgun) Winchester M1887 Gold.
  LightningAR1             - (*int*) (Assault Rifle) Lightning AR-1.
  M24                      - (*int*) (Sniper Rifle) M24.
  DualInfinity             - (*int*) (Pistol) Dual Infinity.
  DualInfinityCustom       - (*int*) (Pistol) Dual Infinity Custom.
  QBB95AdditionalMag       - (*int*) (Machine Gun) QBB-95 EX.
  MP7A1ExtendedMag         - (*int*) (Sub-machine Gun) MP7A1 60R.
  SawedOffM79              - (*int*) (Pistol) M79 Saw Off.
  DualInfinityFinal        - (*int*) (Pistol) Dual Infinity Final.
  Crossbow                 - (*int*) (Assault Rifle) Crossbow.
  USAS12CAMO               - (*int*) (Shotgun) USAS-12 CAMO.
  DoubleBarrelShotgun      - (*int*) (Shotgun) Double Barrel Shotgun.
  KrissSuperV              - (*int*) (Sub-machine Gun) Kriss Super V.
  TAR21                    - (*int*) (Assault Rifle) TAR-21.
  BarrettM95               - (*int*) (Sniper Rifle) Barrett M95
  DualKriss                - (*int*) (Sub-machine Gun) Dual Kriss Super V.
  AN94                     - (*int*) (Assault Rifle) AN-94.
  M16A4                    - (*int*) (Assault Rifle) M16A4.
  P90Lapin                 - (*int*) (Sub-machine Gun) P90 Lapin.
  Volcano                  - (*int*) (Shotgun) Volcano.
  MG36                     - (*int*) (Machine Gun) MG36.
  Salamander               - (*int*) (Equipment) Salamander.
  LightningSG1             - (*int*) (Shotgun) Lightning SG-1.
  Tempest                  - (*int*) (Sub-machine Gun) Tempest.
  BlackDragonCannon        - (*int*) (Equipment) Black Dragon Cannon.
  TMPDragon                - (*int*) (Sub-machine Gun) TMP Dragon.
  MK48                     - (*int*) (Machine Gun) MK48.
  FNFNC                    - (*int*) (Assault Rifle) FN FNC.
  L85A2                    - (*int*) (Assault Rifle) L85A2.
  AKM                      - (*int*) (Assault Rifle) AKM.
  HK416                    - (*int*) (Assault Rifle) HK416.
  LightningAR2             - (*int*) (Assault Rifle) Lightning AR-2.
  Ethereal                 - (*int*) (Assault Rifle) Ethereal.
  M32MGL                   - (*int*) (Equipment) M32 MGL.
  BALROGVII                - (*int*) (Machine Gun) BALROG-VII.
  OICW                     - (*int*) (Assault Rifle) OICW.
  TripleBarrelShotgun      - (*int*) (Shotgun) Triple Barrel Shotgun.
  Ripper                   - (*int*) (Equipment) Ripper.
  K3                       - (*int*) (Machine Gun) K3.
  Needler                  - (*int*) (Sub-machine Gun) Needler.
  SKULL4                   - (*int*) (Assault Rifle) SKULL-4.
  BALROGXI                 - (*int*) (Shotgun) BALROG-XI.
  AK74U                    - (*int*) (Assault Rifle) AK-74U.
  PlasmaGun                - (*int*) (Assault Rifle) Plasma Gun.
  Leviathan                - (*int*) (Equipment) Leviathan.
  UTS15PinkGold            - (*int*) (Shotgun) UTS-15 Pink Gold.
  CompoundBow              - (*int*) (Assault Rifle) Compound Bow.
  ARX160                   - (*int*) (Assault Rifle) ARX-160.
  GaeBolg                  - (*int*) (Equipment) Gae Bolg.
  Cyclone                  - (*int*) (Pistol) Cyclone.
  SPAS12Maverick           - (*int*) (Shotgun) SPAS-12 Maverick.
  Aeolis                   - (*int*) (Machine Gun) Aeolis.
  PetrolBoomer             - (*int*) (Equipment) Petrol Boomer.
  RailCannon               - (*int*) (Shotgun) Rail Cannon.
  Eruptor                  - (*int*) (Equipment) Erupt Cannon.
  Slasher                  - (*int*) (Equipment) Slasher.
  RPG7                     - (*int*) (Equipment) RPG-7.
  Guillotine               - (*int*) (Equipment) Blood Dripper.
  CrossbowAdvance          - (*int*) (Assault Rifle) Advanced Crossbow.
  FireVulcan               - (*int*) (Shotgun) Fire Vulcan.
  JackHammer               - (*int*) (Shotgun) Jack Hammer.
  Coilgun                  - (*int*) (Machine Gun) Coil Gun.
  DualUZI                  - (*int*) (Sub-machine Gun) Dual UZI.
  LaserMinigun             - (*int*) (Machine Gun) Laser Minigun.
  M4A1DarkKnight           - (*int*) (Assault Rifle) M4A1 Dark Knight.
  AK47Paladin              - (*int*) (Assault Rifle) AK-47 Paladin.
  AttackM950               - (*int*) (Pistol) Attack M950.
  MagnumDrill              - (*int*) (Equipment) Magnum Drill.
  DesertEagleCrimsonHunter - (*int*) (Pistol) Desert Eagle Crimson Hunter.
  FlameJackhammer          - (*int*) (Shotgun) Flame Jack Hammer.
  SG552Lycanthrope         - (*int*) (Assault Rifle) SG552 Lycanthrope.
  BroadDivine              - (*int*) (Machine Gun) Broad Divine
  PythonDesperado          - (*int*) (Pistol) Python Desperado.
  CHARGER7                 - (*int*) (Machine Gun) CHARGER-7.
  BOUNCER                  - (*int*) (Shotgun) BOUNCER.
  StunRifle                - (*int*) (Assault Rifle) Stun Rifle.
  DualBerettaGunslinger    - (*int*) (Pistol) Dual Beretta Gunslinger.
  M249Phoenix              - (*int*) (Machine Gun) M249 Phoenix.
  StarChaserAR             - (*int*) (Assault Rifle) Star Chaser AR.
  M32MGLVenom              - (*int*) (Equipment) M32 MGL Venom.
  MG3CSOGSEdition          - (*int*) (Machine Gun) MG3 10th Edition.
  ThunderGhostWalker       - (*int*) (Pistol) Thunder Ghost Walker.
  Stinger                  - (*int*) (Equipment) Stinger.
  InfinityLaserFist        - (*int*) (Sub-machine Gun) Infinity Laser Fist.
  ShiningHeartRod          - (*int*) (Machine Gun) Shining Heart Rod.
]]

